package edu.ynu.se.xiecheng.achitectureclass.entity;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Where;

import javax.persistence.*;

@Entity
@Getter
@Setter
@Table(name = "shop_item")
@Where(clause = "is_deleted = 0")
public class ShopItem extends LogicEntity {
    @Column
    private String shopItemName;
    @Column
    private Double price;
    @Column(nullable = false,
            columnDefinition="INT default 0")
    private Integer shelfStatus;

    @ManyToOne(fetch = FetchType.LAZY)
    @JsonIgnoreProperties("shopItems")
    private Shop shop;

    @ManyToOne(fetch = FetchType.LAZY)
    @JsonIgnoreProperties("shopItems")
    private Item item;


}
